package com.soboot.gateway;

import com.soboot.log.utils.LogUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
 * @Author:
 * @createTime: 2022年09月19日 17:40:34
 * @version: 1.0
 * @Description: 网关启动类
 * @Copyright:
 */
@RefreshScope
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"com.soboot.*","com.soboot.gateway.*"})
public class GatewayApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(GatewayApplication.class);
        //记录应用PID写入当前目录application.pid下
        springApplication.addListeners(new ApplicationPidFileWriter());
        springApplication.run(args);
        LogUtil.info("网关服务启动成功!");
    }
}
